/* eslint-disable react/jsx-pascal-case */
// import Order_msg from './order_msg'
import { View, Text, Input, Icon, Image, Button } from '@tarojs/components';
import { AtTabs, AtTabsPane, AtCountdown } from 'taro-ui';
import React, { useState, useEffect } from "react";
import Taro, {useRouter, getCurrentInstance} from '@tarojs/taro';
import './groupMoban.scss'
import store from "../../../store";
import http from "../../../utils/http";

// jp

// const go1 = () => {
//   Taro.navigateBack({
//     url: '/pages/Group/group_faqi/groupFaqi'
//   })
// }

const groupMoban = () => {
    const [val,setVal] = useState([{
        img:'../../../static/img/dingdan.png',name:'精品泰国桂圆 1000g/盒',pintuan:'3人成团',tihuodian:'提货点：鲜丰水果',
        thTime:'下单2小时后',zt:'进行中',day:'0',hours:'0',minutes:'0',seconds:'0',jiage:'7.8'
      },
      {
        img:'../../../static/img/guanlirenyuan.png',name:'精品泰国桂圆 1000g/盒',pintuan:'5人成团',tihuodian:'提货点：鲜丰水果',
        thTime:'下单4小时后',zt:'已结束',day:'0',hours:'0',minutes:'0',seconds:'0',jiage:'9.8'
      }
    ])
    
    useEffect(() => {
      http({
        url: "/merchant/GoodsMouldQueryList",
        method: "post",
      }).then(res => {
        console.log(res);
        if(res.data.code == 200){
          console.log("成功")
          // console.log(res.data)
          console.log(res.data.data)
          store.s_jp.setMoBan(res.data.data)
          console.log(store.s_jp.MoBan)
        }else{
          console.log("失败")
        }
      });
    },[]);

  return (
  <View>
    {
          val.map((item,index)=>(
            <View className='com_img' >
            <Image src={item.img}></Image>
            <View className='com_tishi'>{item.zt}</View>
            <View className='com_text'>
                <View className='at-row text_one'>
                    <View className='at-col at-col-9'>
                        <Text className='t_people'>{item.pintuan}</Text>
                        <Text> {item.name}</Text>
                    </View>
                    <View className='at-col at-col-3 text_right'>
                        <Text>￥{item.jiage}</Text>
                        <Text className='del_line'> ￥14.6</Text>
                    </View>
                </View>
                <View className='at-row text_two'>
                    <Text className='at-col at-col-8'>已成5团 / 可成10团 / 每人限购1分</Text>
                    <Text className='at-col at-col-4 text_right'>{item.tihuodian}</Text>
                </View>
                <View className='at-row text_three'>
                    <View className='at-col at-col-9'>
                        <Text>剩余 </Text>
                        <AtCountdown
                          className='green'
                          format={{ day: '天', hours: ':', minutes: ':', seconds: '' }}
                          isCard
                          isShowDay
                          day={item.day}
                          hours={item.hours}
                          minutes={item.minutes}
                          seconds={item.seconds}
                        />
                    </View>
                    <View className='at-col at-col-3 text_right'>{item.thTime}</View>
                </View>
            </View>
        </View>
          ))
        }
  </View>
  )
}
export default groupMoban;